<include file="Common/header" />

<div class="content">
    <div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider="{directionNav:false}">
        <ul class="am-slides">
            <volist name="newData" id="vo">
                <li>
                    <a href="{$vo.url}">
                        <img src="{$vo.picurl}" data-holder-rendered="true" />
                    </a>
                </li>
            </volist>
        </ul>
    </div>

    <div data-am-widget="list_news" class="am-list-news am-list-news-default" >

        <div class="am-list-news-bd">
            <ul class="am-list" id="newContent">
                <?php foreach($newsArr as $k => $v){ ?>

                <?php if($v['titlepic']){ ?>
                <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                    <div class="am-u-sm-4 am-list-thumb">
                        <a href="<?php echo $v['titleurl']; ?>">
                            <?php  $titlepic = str_replace("http://www.haotoufa.com", "", $v['titlepic']); ?>
                            <img src="http://www.haotoufa.com<?php echo $titlepic; ?>"/>
                        </a>
                    </div>
                    <div class=" am-u-sm-8 am-list-main">
                        <h3 class="am-list-item-hd">
                            <a href="<?php echo $v['titleurl']; ?>" class=""><?php echo $v['title']; ?></a>
                        </h3>
                        <div class="am-list-item-text">
                            <?php echo html_entity_decode($v['smalltext']); ?>
                        </div>
                    </div>
                </li>
                <?php }else{?>
                <li class="am-g am-list-item-desced">

                    <div class=" am-list-main">
                        <h3 class="am-list-item-hd"><a href="<?php echo $v['titleurl']; ?>" class=""><?php echo $v['title']; ?></a></h3>

                        <div class="am-list-item-text"><?php echo html_entity_decode($v['smalltext']); ?></div>

                    </div>
                </li>
                <?php }?>
                <?php } ?>

                <!--没有更多了显示信息-->
                <div class="am-g am-text-center" id="next-page" url="/Index/slideUp/page/2">
                    <i class="am-icon-arrow-circle-o-down"></i>&nbsp; 加载中<i class="am-icon-spinner am-icon-spin"></i>...

                    <script type="text/javascript">
                        $('#next-page').scrollspy({
                            animation: 'slide-top',
                            repeat: false
                        });
                        $('#next-page').on('inview.scrollspy.amui', function() {
                            var url = $(this).attr('url');
                            if('end' !== url){
                                $.ajax({
                                    beforeSend: function(){
                                        return true;
                                    },
                                    complete: function(){
                                        return true;
                                    },
                                    url: $(this).attr('url'),
                                    dataType: "html",
                                    type: "POST",
                                    cache: false,
                                    async:true,
                                    success: function(html){
                                        $('#next-page').remove();
                                        $('#newContent').append(html);
                                    }
                                });
                            }
                        });
                    </script>

                </div>

            </ul>
        </div>
    </div>
</div>



<include file="Common/footer" />

<script type="text/javascript">
    $(function(){
        if (("standalone" in window.navigator) && window.navigator.standalone) {
            // If you want to prevent remote links in standalone web apps opening Mobile Safari, change 'remotes' to true
            var noddy,
                    remotes = false;
            document.addEventListener('click', function(event) {
                noddy = event.target;
                //Bubble up until we hit link or top HTML element. Warning: BODY element is not compulsory so better to stop on HTML
                while (noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
                    noddy = noddy.parentNode;
                }
                if ('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes)) {
                    event.preventDefault();
                    document.location.href = noddy.href;
                }
            }, false);
        }
    })
</script>
</body>
</html>